After completing this lab, you will be able to:
Specify IP Repository
Click OK to automatically connect the S_AXI interface to the Zynq GP0 port (through the AXI interconnect block), and the GPIO port to an external interface. Rename the port leds_4bits to leds.
At this stage the design should look like as shown below.
Block Design After add LED
Click on Run Connection Automation, ensure math_ip_0 and S_AXI are selected, and click OK.
The Math IP consists of a hierarchical design with the lower-level module performing the addition. The higher-level module includes the two slave registers.
Custom Core's Main Functional Block
We want to connect the ILA core to the LED interface. Vivado prohibits connecting ILA cores to interfaces. In order to monitor the LED output signals, we need to convert the LED interface to simple output port.
Make the gpio_io_o port External
The port connector named gpio_io_o will be created and connected to the port.
Enabling cross triggering in the Zynq processing system
probe_in -> result
probe_out0 -> sel
probe_out1 -> ain_vio
probe_out2 -> bin_vio
VIO added and connections made
Right-click and select Debug to monitor the AXI4Lite transactions.
Notice that a system_ila IP instance got added and the M03_AXI <-> S_AXI connection is connected to its SLOT_0_AXI interface.
Change AXI Read Address and AXI Read Data channels to Data since we will not trigger any signals of those channels.
This saves resources being used by the design.
Selecting channels for debugging
Run Design Validation (Tools -> Validate Design) and verify there are no errors.
The design should now look similar to the diagram below
Completed Design
Select lab6.c and click Finish.
A snippet of the part of the source code is shown in the following figure. It shows that two operands are written to the custom core, the result is read, and printed out. The write transaction will be used as a trigger condition in the Vivado Logic Analyzer.
Source Code snippet
Enable cross triggering in the software environment
Enabling CPU0 for request from PL
Enabling CPU0 for request to PL
Add a Serial Port
Connect to Serial Port
Select Window > Debug Probes
The hardware session will open showing the Debug Probes tab in the Console view.
Debug probes
The hardware session status window also opens showing that the FPGA is programmed (we did it in Vitis IDE), there are three cores out of which the two ila cores are in the idle state.
Hardware session status
Opening the waveform window
Trigger Setup
Setting up the ILA
Hardware analyzer running and in capture mode
Setting a breakpoint
Zoomed waveform view of the three AXI transactions
Observe the following:
Around the 512th sample WDATA being written is 0x012 at offset 0 (AWADDR=0x0). At the 536th sample, offset is 0x4 (AWADDR), and the data being written is 0x034. At the 559th sample, data is being read from the IP at the offset 0x0 (ARADDR), and at 561th mark the result (0x46) is on the RDATA bus.
VIO probes
Input stimuli through the VIO core's probes
Setting up Trigger for hw_ila_1
Ensure that the trigger position for the hw_ila_1 is set to 512.
Make sure that the switches are not set to 11 on PYNQ-Z2 as this is the exit pattern.
Right-click on the hw_ila_1 in the hardware window, and arm the trigger by selecting Run Trigger. The hardware analyzer should be waiting for the trigger condition to occur.
ILA waveform window after Trigger
ILA Core Properties
In Vitis IDE, in the Design view, relaunch the software by right clicking on the lab6 project, and selecting Debug As > Launch Hardware (Single Application Debug). Click OK if prompted to relanuch.
The program will be loaded and the excution will suspend at the entry point
In Vitis IDE continue execution of the software to the next breakpoint (line 27).
When the next breakpoint is reached, return to Vivado and notice the ILA has triggered.
In this lab, you added a custom core with extra ports so you can debug the design using the VIO core. You instantiated the ILA and the VIO cores into the design. You used Mark Debug feature of Vivado to debug the AXI transactions on the custom peripheral. You then opened the hardware session from Vivado, setup various cores, and verified the design and core functionality using Vitis IDE and the hardware analyzer.